//
//  YKWebViewController.m
//  HMPersonalDoctor
//
//  Created by 叶文凯 on 16/9/11.
//  Copyright © 2016年 geduo. All rights reserved.
//

#import "YKWebViewController.h"

@interface YKWebViewController ()<UIWebViewDelegate>
@property(weak,nonatomic)UIWebView *webView;

@end

@implementation YKWebViewController

- (void)viewDidLoad {
    [super viewDidLoad];
   
    UIWebView *webView = [[UIWebView alloc] initWithFrame:self.view.bounds];
    
    webView.delegate = self;
    self.webView = webView;
 
    [self.view addSubview:webView];
    
    if (self.tag == 8) {
        
        [self loadCategoryButtonWeb];
    }

    if (self.tag == 1) {
        [self loadDoctlistAskWeb];
    }
    
    if (self.tag == 2) {
        
        [self loadRequireHospitalWeb];
        
    }
    
}

- (void)loadCategoryButtonWeb
{
    
    NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://3g.xywy.com/so/?channel=zongheSo&f_s=expert&fromurl=xywy_app"]];
    
    [self.webView loadRequest:request];
    
    
}

- (void)loadDoctlistAskWeb
{
    
    NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://3g.xywy.com/so/?channel=zongheSo&f_s=expert&fromurl=xywy_app"]];
    
    [self.webView loadRequest:request];

    
    
}

- (void)loadRequireHospitalWeb
{
    
    self.automaticallyAdjustsScrollViewInsets = NO;
    self.webView.scrollView.bounces = NO;
    
    NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://3g.zhuanjia.xywy.com/nplus/index.htm"]];

    [self.webView loadRequest:request];

    
}

- (void)setTag:(NSInteger)tag
{
    _tag = tag;
}

// js 和oc交互

- (void)webViewDidFinishLoad:(UIWebView *)webView
{
    
//    没有前端就算了！
    
    
    
    
}




- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
}

@end
